const bcrypt = require('bcryptjs')
const { sequelize } = require('../../../core/db');
const { Sequelize,Model } = require('sequelize');
const { NotFound,AuthFailed } = require('../../../core/httpException');

// 商品表
class Goods extends Model{

}

Goods.init({
    id:{
        type:Sequelize.INTEGER,
        primaryKey:true,
        autoIncrement:true
    },
    class_id:{
        type:Sequelize.INTEGER
    },
    attr_list:Sequelize.TEXT, //属性json
    name:Sequelize.STRING, //名字
    desc:Sequelize.TEXT, //介绍
    img:Sequelize.TEXT, //预览图
    cover:Sequelize.TEXT, // 封面
    price:Sequelize.INTEGER, //价格
    stock:Sequelize.INTEGER, //库存
},{
    sequelize,
    tableName:'goods'
})

// Goods.sync({alter:true})
module.exports = { Goods }